home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_200 / 263_02 / menu.c < prev    next >
Text File  |  1990-02-13  |  753b  |  27 lines

  1. #include <stdio.h>
  2. #include <c_wndw.h>
  3.  
  4. /*
  5. *    Copyright 1989, Marietta Systems, Inc.
  6. *    All rights reserved
  7. */
  8.  
  9. /*
  10. *     This program shows the use of a simple menu.  There are four options
  11. *    but only three of them are allowed.  When you select an option, a
  12. *    window with the name of the option is displayed.
  13. */
  14.  
  15. void main() {
  16.      int ret = 1;
  17.      char *input[21] = {"First choice", "Second choice",  "Third choice"};
  18.      clr_scrn ("Menu test");
  19.      display ("Select option from menu:", 2, 2, alt_high);
  20.      flt_wndw (4, 6, "Menu");
  21.      ret = menu ("First&Second&Third&Fourth|", 6, ret, 1);
  22.      if (ret > 0)   /* Not F10 or ESC */
  23.           err_wndw (input[ret - 1], ret, 0); /* display choice */
  24.      rm_wndw();
  25.      goodbye (0);
  26. }
  27.